angular.module('keepApp')

.controller('ideaTrain',['$scope','$http','$rootScope',function($scope,$http,$rootScope){

	$http({
	        method: 'GET',
	        url: './train/data/train.json'
	    }).then(function (obj) {
	    	$scope.Data=obj.data.data[0].data;
		}, function (err) {
		    console.log(err);
	    });
}])
.controller('mineTrain',['$scope','$http','$rootScope',function($scope,$http,$rootScope){
	$http({
	        method: 'GET',
	        url: './train/data/train.json'
	    }).then(function (obj) {
	    	$scope.picture=obj.data.data[1].data[0].picture;
	    	$scope.description=obj.data.data[1].data[0].description;
	    	$scope.title=obj.data.data[1].data[0].title;
		}, function (err) {
		    console.log(err);
	    });

}])
.controller('ideaRead',['$scope','$http','$rootScope',function($scope,$http,$rootScope){
	$http({
	        method: 'GET',
	        url: './train/data/train.json'
	    }).then(function (obj) {
	    	$scope.Data=obj.data.data[2].data;
		}, function (err) {
		    console.log(err);
	    });

}])

.controller('mineTable',['$scope','$http','$rootScope',function($scope,$http,$rootScope){
	$http({
	        method: 'GET',
	        url: './train/data/train.json'
	    }).then(function (obj) {
	    	$scope.picture=obj.data.data[3].data[0].picture;
	    	$scope.description=obj.data.data[3].data[0].description;
	    	$scope.title=obj.data.data[3].data[0].title;
		}, function (err) {
		    console.log(err);
	    });



}])
